package io;

import com.sun.org.apache.xpath.internal.WhitespaceStrippingElementMatcher;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * 缓冲输出流写出数据的缓冲区问题
 */
public class BufferedOutputDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("./too.txt");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        String line="从世界尽头看你的样子应该是最美的";
        bos.write(line.getBytes(StandardCharsets.UTF_8));
        bos.flush();
        System.out.println("写出完毕");
        bos.close();




    }
}
